from sys import exit
tem=int(input())
tem_unit=input().upper()


if tem_unit not in ['C','F']:
    print("wrong input!")
    exit()

height=input().strip()
if  height.isnumeric()==False:
   print("wrong input!")
   exit()

height_unit=input().upper()

if height_unit not in ['M','FT']:
   print("wrong input!")
   exit()

if tem_unit=='F':
   tem_c=(tem-32)*5/9
else:tem_c=tem
height=float(height)
if height_unit=='ft':
   height_m=height*0.3048
else:height_m=height
point=100-(height_m/300)

if tem_c<0:
    state="solid"
elif tem_c<point:
    state="liquid"
else:state="gaseous"
print(state)
